{% extends 'application.html' %}
{% block content %}
<div class="row">
    {% include '_nav.html' %}
    <div class="span6"></div>
</div>
<div class="row"> 
    <div class="span6"> 
        <table class="table">
            <thead>    
                <tr>
                    <th>#</th>
                    <th>添加节点</th>
                    <th>*</th>
                </tr>
            </thead>
            <tbody>
            {% if host %}
                <tr>
                    <td>节点名称</td>
                    <td><input type="text" id="node_name" placeholder="节点名称"></td>
                    <td>*</td>
                </tr>
                <tr>
                    <td>所属分组</td>
                    <td>
                        <select id="node_level">
                            {% for level in levels %}
                            <option value="{{level.id}}">{{level.name}}</option>
                            {% endfor %}
                        </select>
                    </td>
                    <td>*</td>
                </tr>
                <tr>
                    <td>节点token</td>
                    <td>
                        <input type="hidden" id="host" value="{{host}}">
                        <input type="text" id="token" placeholder="节点token">
                    </td>
                    <td>*</td>
                </tr>
                <tr>
                    <td>#</td>
                    <td><button type="button" class="btn" onclick="token_node()">添加节点</button></td>
                    <td>*</td>
                </tr>
            {% else %}
                <tr>
                    <td>节点IP</td>
                    <td><input type="text" id="host"></td>
                    <td>*</td>
                </tr>
                <tr>
                    <td>#</td>
                    <td><button type="button" class="btn" onclick="new_node()">添加节点</button></td>
                    <td>*</td>
                </tr>
            {% endif %}
            </tbody>
        </table>
    </div>
</div>
{% endblock %}
